import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2023-08-09
 * Time: 21:57
 */
public class IODemo5 {
    public static void main(String[] args) {
        try (Reader reader = new FileReader("d:/test.txt")){
            while (true) {
                int ch = reader.read();
                if (ch == -1) {
                    break;
                }
                System.out.print((char)ch + " ");
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
